//
//  HotModel.m
//  UI19 - Car(汽车之家)
//
//  Created by 韩旭 on 16/8/9.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "HotModel.h"

@implementation HotModel
- (instancetype)initWithDic:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
+ (instancetype)hotModelDic:(NSDictionary *)dic {
    return [[HotModel alloc] initWithDic:dic];
}
+ (NSArray *)groupsArray {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"HotJSON" ofType:@"json"];
    NSMutableArray *arrAll = [NSMutableArray array];
    NSData *data = [NSData dataWithContentsOfFile:path];
    NSDictionary *dicJson = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
    NSDictionary *result = dicJson[@"result"];
    NSArray *arrList = result[@"list"];
    for (NSDictionary *dic in arrList) {
        [arrAll addObject:[HotModel hotModelDic:dic]];
    }
    return arrAll;
}

@end
